/**
 * 
 */
package cnpm02.j2ee.group3.model;

import javax.persistence.Column;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.MappedSuperclass;

import org.hibernate.validator.NotNull;

/**
 * @author BINH
 *
 */
@MappedSuperclass
public abstract class AbstractTranslationEntity extends AbstractEntity {
	private static final long serialVersionUID = 1L;
	
	public AbstractTranslationEntity(){
		super();
	}
	
	public AbstractTranslationEntity(SupportedLanguage lang, String translation) {
		this.supportedLanguage = lang;
		this.translation = translation;
	}
	
	@NotNull
	@Enumerated(EnumType.STRING)
	@Column(name = "Language", nullable = false, length = 2)
	private SupportedLanguage supportedLanguage;
	
	@NotNull
	@Column(name = "Translation", nullable = false)
	private String translation;

	public void setSupportedLanguage(SupportedLanguage language) {
		this.supportedLanguage = language;
	}

	
	public SupportedLanguage getSupportedLanguage() {
		return supportedLanguage;
	}

	public void setTranslation(String translation) {
		this.translation = translation;
	}

	public String getTranslation() {
		return translation;
	}
}
